#include <bits/stdc++.h>

using namespace std;

int main(int argc, char const *argv[])
{
	string s;
	cin>>s;
	int cnt=0;
	for (int i = 0; i < s.size(); ++i)
	{
		cnt+=s[i]-'0';
	}
	printf("%d\n", cnt);
	return 0;
}